package miagk.elementy;

import miagk.menu.R;
import android.content.res.Resources;

import com.threed.jpct.Loader;
import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;

public class Opornik implements Element {

	private Object3D model;
	private float x, y, z;
	private float skala;
	private String nazwa;
	private boolean naPlytce, zepsuty, dostepny;
	
	public Opornik(Resources res, float _x, float _y, float _z){
		zepsuty=false;
		dostepny=false;
		naPlytce=false;
		nazwa="Opornik";
		x=_x;
		y=_y;
		z=_z;
		
		Object3D[] model2 = Loader.load3DS(res.openRawResource(R.raw.opornik_3ds), 0.02f);
		
		model = Object3D.mergeAll(model2);
		model.strip();
		model.build();
		model.setCenter(new SimpleVector(0.0f,0,0));
		model.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
	}

	public void refreshModel(){
		//model.position().x=recalculatePosition(x);
	}
	
	private float recalculatePosition(int a){
		return 1.0f;
	}
	
	public Object3D getModel() {
		return model;
	}

	public float getScale(){
		return skala;
	}
	
	public void setScale(float s){
		skala=s;
	}
	
	public float getX() {
		return x;
	}

	public float getY() {
		return y;
	}

	public float getZ() {
		return z;
	}

	public String getName() {
		return nazwa;
	}

	public void setModel(Object3D m) {
		this.model=m;
	}

	public void setX(float _x) {
		x=_x;
	}

	public void setY(float _y) {
		y=_y;
	}

	public void setZ(float _z) {
		z=_z;
	}

	public void setName(String name) {
		nazwa=name;
	}

	public void setCzyZepsuty(boolean czyZ) {
		zepsuty=czyZ;
	}

	public void setCzyWUkladzie(boolean czyNP) {
		naPlytce=czyNP;
	}

	public boolean czyZepsuty() {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean CzyNaPlytce() {
		return naPlytce;
	}

	public void animuj() {
		//obiekt nieanimowany
	}

}
